﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DomainModel.Concrete;
using DomainModel.Entities;

namespace WebUI.Controllers
{
    public class LyricsController : Controller
    {
        private ActionResult HandleMyError(Exception ex)
        {
            var modelErr = new ErrorHandling(ex);
            return View("Error", modelErr);
        }

        #region PublicActions
        public ActionResult Index() { return View(); }
        public ActionResult Details(int id) { return View(); }
        public ActionResult Create() { return View(); }
        
        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            { 
                return RedirectToAction("Index"); 
            }
            catch (Exception ex) 
            { 
                return HandleMyError(ex); 
            }
        }

        public ActionResult Edit(int id)
        { 
            return View(); 
        }

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                return RedirectToAction("Index");
            }
            catch (Exception ex)
            {
                return HandleMyError(ex);
            }
        }

        public ActionResult Delete(int id)
        { 
            return View(); 
        }

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                return RedirectToAction("Index");
            }
            catch (Exception ex)
            {
                return HandleMyError(ex);
            }
        }
        #endregion
    }
}
